<template>
	<view>
		<!-- 选择商品品牌 -->
		<!-- 需改************ -->
		<u-picker :show="message.spDanWeiShow" :columns="columns" title="商品单位" @cancel="confirm" @confirm="confirm"
			keyName="name"></u-picker>
	</view>
</template>

<script>
	const httpRequest = require("@/common/httpRequest.js")
	export default {
		name:"selectSPDanWei",//需改************
		props:{
			message:{}
		},
		data() {
			return {
				columns:[],
			};
		},
		watch:{
			message:{
				handler(newval){
					this.columns=[]
					let type = 0
					if(this.message.spDanWeiSTatus==1){
						type=3
					} else if(this.message.spDanWeiSTatus==2){
						type=2
					} else if(this.message.spDanWeiSTatus==3){
						type=1
					}
					httpRequest.request('/dhtapi/goods/goodsUnit', 'GET', {
						type
					}, false, false, true).then(res => {
						this.columns.push(res.data)
					})
				},
				deep:true
			}
		},
		mounted() {
			
		},
		methods:{
			confirm(e){
				this.$emit("spDanWeiSure", e);//需改************
			}	
		}
		
	}
</script>

<style lang="scss" scoped>
	/deep/.u-popup__content{
		width: 100% !important;
	}
</style>